import { defineStore } from 'pinia'

const useModalStore = defineStore('modal', {
  state: () => ({
    visible: false, // 是否显示
    cardUid: -1, // 图片uid
  }),
  actions: {
    show() {
      this.visible = true
    },
    hidden() {
      this.visible = false
    },
    setVisible(visible: boolean, cardUid: number = -1) {
      this.visible = visible
      this.cardUid = cardUid
    },
  },
})

export default useModalStore
